package Stream;

import javax.naming.Name;
import java.util.ArrayList;
import java.util.List;

public class demo2 {
    public static void main(String[] args) {
        //使用Stream流示例代码
        //集合的批量添加
        ArrayList<String> list1 = new ArrayList<>(List.of("张三丰","张无忌","张翠山","王二麻子","张良","谢广坤"));
        list1.stream().filter(name->name.startsWith("张")).filter(name->name.length()==3).forEach(name-> System.out.println(name));
    }
}
